package atom.config 
{
	import atom.loader.IAsset;
	import atom.loader.ILoader;
	import atom.loader.types.AssetData;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	/**
	 * ...
	 * @author Jorge Braccini
	 */
	public class ApplicationConfig extends AssetData implements ILoader, IAsset {
		
		private static var _instance:ApplicationConfig;
		public static function get instance():ApplicationConfig {
			if (!_instance) _instance = new ApplicationConfig(new Force());
			return _instance;
		}
		
		public function ApplicationConfig(force:Force) {
			super("dataFeed", "files/data.xml");
		}
		
		override protected function redispatch(e:Event):void {
			if (e.type != Event.COMPLETE) super.redispatch(e);
			else initialize();
		}
		
		//HACK PARA QUE NO CARGUE NADA X AHORA
		override public function load():void {
			initialize();
		}
		
		private function initialize():void {
			dispatchEvent(new Event(Event.COMPLETE));
		}
		
	}

}

class Force { }